<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/ichart.1.2.min.js"></script>
    <title>Title</title>
</head>
<body>
    <div id="canvasDiv">

    </div>
</body>
<script>
    $(function(){
        var flow=[];
        for(var i=0;i<21;i++){
            flow.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
        }
        var data = [
            {
                name : 'PV',
                value:flow,
                color:'#0d8ecf',
                line_width:2
            }
        ];
        var labels = ["22 18:51","22 18:54:55","22 18:54:55","22 18:54:55","22 18:54:55","22 18:54:55","22 18:41:05","22 18:40:25","22 18:42:12","22 18:53:34"];
        var line = new iChart.LineBasic2D({
            render : 'canvasDiv',
            data: data,
            align:'center',
            title : '温度统计图',
            subtitle : '平均18:00-22:00访问量达到最大值(单位：万)',
//            footnote : '数据来源：模拟数据',
            width : 800,
            height : 400,
            sub_option:{
                smooth : true,//平滑曲线
                point_size:10
            },
            tip:{
                enable:true,
                shadow:true
            },
            legend : {
                enable : false
            },
            crosshair:{
                enable:true,
                line_color:'#62bce9'
            },
            coordinate:{
                width:600,
                valid_width:500,
                height:260,
                axis:{
                    color:'#9f9f9f',
                    width:[0,0,2,2]
                },
                grids:{
                    vertical:{
                        way:'share_alike',
                        value:12
                    }
                },
                scale:[{
                    position:'left',
                    start_scale:0,
                    end_scale:100,
                    scale_space:10,
                    scale_size:2,
                    scale_color:'#9f9f9f'
                },{
                    position:'bottom',
                    labels:labels
                }]
            }
        });
        //开始画图
        line.draw();
    });
</script>
</html>